objectives:
%matplotlib inline
import matplotlib.pyplot as plt
from skimage.feature import hog
from skimage import data, color, exposure
from skimage.io import imread
import numpy as np
image = imread('night1.pgm')
plt.figure(figsize=[20,15])
plt.imshow(image)
plt.colorbar();
%matplotlib inline
import matplotlib.pyplot as plt
from skimage.feature import hog
from skimage import data, color, exposure
from skimage.io import imread
import numpy as np
image = imread('day1.ppm')
fd, hog_image = hog(image, orientations=8, pixels_per_cell=(64, 64),
cells_per_block=(1, 1), visualise=True)
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(20,25), sharex=True, sharey=True)
ax1.axis('off')
ax1.imshow(image, cmap=plt.cm.gray)
ax1.set_title('Input image')
ax1.set_adjustable('box-forced')
# Rescale histogram for better display
hog_image_rescaled = exposure.rescale_intensity(hog_image, in_range=(0, 5))
ax2.axis('off')
ax2.imshow(hog_image_rescaled, cmap=plt.cm.gray)
ax2.set_title('Histogram of Oriented Gradients')
ax1.set_adjustable('box-forced')
plt.show()
ima = (imread('327254586.pgm').sum(axis=2)/3).astype(np.uint8)
plt.imshow(ima,cmap=plt.cm.gray)
plt.colorbar();